<template>
  <div class="app-container">

    <el-table v-loading="loading" :data="performanceList" @selection-change="handleSelectionChange">
            <el-table-column label="序号" align="center">
        <template slot-scope="scope">
          {{ (scope.$index + 1) }}
        </template>
      </el-table-column>
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="标段" align="center" prop="section" />
      <el-table-column label="参与项目开始时间" align="center" prop="projectStartTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.projectStartTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="参与项目结束时间" align="center" prop="projectEndTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.projectEndTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="担任职务" align="center" prop="positionHeld" />
      <el-table-column label="担任职务开始日期" align="center" prop="positionStartDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.positionStartDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="担任职务结束日期" align="center" prop="positionEndDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.positionEndDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
    </el-table>


  </div>
</template>

<script>
import { getPerformance } from "@/api/system/performance";

export default {
  name: "Performance",
  data() {
    return {
      // 总条数
      total: 0,
      // 个人项目业绩(项目库的负责人)表格数据
      performanceList: [],
      // 人才id
      talentId: 3,
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询个人项目业绩(项目库的负责人)列表 */
    getList() {
      this.loading = true;
      getPerformance(this.talentId).then(response => {
        this.performanceList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      console.log(this.performanceList);
    },
  }
};
</script>
